package com.jimline.newRate.ui.main;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;

public class CustomDialog extends JDialog{
	
	public CustomDialog(String title, String text)
	{
	    this.setTitle(title);
	    Box mainBox = Box.createVerticalBox();
	    JLabel lbl = new JLabel(text);
	    JButton btn = new JButton("确定");
	    btn.addMouseListener(new MouseAdapter() {
	        public void mousePressed(MouseEvent e) {
	    	    exitDialog();
	        }
	    });
	    mainBox.add(lbl);
	    mainBox.add(btn);
	    this.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE);
	}
	
	public void exitDialog()
	{
		this.exitDialog();
	}
}
